package org.dromara.common.core.domain.dto

import java.io.Serial
import java.io.Serializable
import java.util.HashMap

/**
 * 启动流程对象
 *
 * @author LikeYouDo
 * @date 2025/09/22
 */
data class StartProcessDTO(
    /**
     * 业务唯一值id
     */
    var businessId: String? = null,

    /**
     * 流程定义编码
     */
    var flowCode: String? = null,

    /**
     * 办理人(可不填 用于覆盖当前节点办理人)
     */
    var handler: String? = null,

    ) : Serializable {
    companion object {
        @Serial
        private const val serialVersionUID = 1L
    }

    /**
     * 流程变量，前端会提交一个元素{'entity': {业务详情数据对象}}
     */
    var variables: MutableMap<String, Any?>? = null
        get() {
            if (field === null) {
                return HashMap(16)
            }
            field!!.entries.removeIf { entry -> entry.value == null }
            return field
        }

}
